package com.edu.springmvc.helloworld.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.sql.Date;

@Data
public class Employee {
    private Integer employeeId;

    @NotBlank(message = "First name cannot be blank")
    private String firstName;

    @NotBlank(message = "Last name cannot be blank")
    private String lastName;

    @Email(message = "Email must be a valid email address")
    private String email;

    private String phoneNumber;

    @JsonFormat(pattern = "yyyy-MM")
    private Date hireDate;

    private String jobId;

    private double salary;

    private Double commissionPct;
    private Integer managerId;
    private String departmentId;

    // 添加自定义验证规则
//    @Pattern(regexp = "^男|^女$", message = "Gender must be either '男' or '女'")
//    private String gender;
}
